This invention concerns the field of automated inspection systems, and, particularly, a system and method useful for scanning a painted surface and detecting defects thereon.
Quality control is an important component of automated production processes. Like the products of the production processes which it scrutinizes, quality control has become increasingly automated over time. For example, automated visual inspection systems, rather than human inspectors, are increasingly being employed to perform repetitive visual scanning of workpieces in order to detect any flaws therein.
In particular, a number of prior art automated scanning systems have been developed which are specifically intended to inspect the surface of a workpiece to detect defects and blemishes in the painted surface thereof. For example, U.S. Pat. No. 5,367,378 to Harding et al. discloses an optical inspection system and method for evaluating the surfaces of large contoured panels. The method involves providing an illumination means for projecting a pattern of lines having a periodic configuration with features having a separation period. A camera records an image of the pattern of lines as reflected from the surface being inspected. The recorded image is evaluated and quantified by calculating a slope of a defect observed by the camera using a specified mathematical relationship. The distance between the illuminated pattern and the surface are used to calculate the defect slope, and a defect depth value is generated using a specific relationship dependent on the length of the defect area visually recognizable from the reflected image and the calculated defect slope.
U.S. Pat. No. 5,389,794 to Allen et al. discloses a surface pit and mound detection and discrimination system. The system scans a beam of radiation over the surface to be inspected, and includes a mechanism for separately sensing radiation scattered from the surface in the near and far specular regions in order to differentiate between pits and mounds and other types of defects. The system includes means for detecting a local slope on the surface from radiation scattered from the surface in the near specular region and for differentiating between whether said beam of radiation is scanning a pit or a mound.
U.S. Pat. No. 5,461,474 to Yoshii et al. discloses an inspection apparatus for detecting foreign matter on a surface having first and second spaced lines. The surface is scanned by a light beam in a direction orthogonal to the lines, and the size of the light beam is less than the interval between the two lines. The system includes detection means for detecting light reflected from the surface from the scanning and producing first and second signals corresponding to the scan of the first surface line and the second surface line, respectively. Signal processing means are provided for processing a correlation between the first and second signals and detecting whether foreign matter exists on the surface. This system is particularly useful for inspecting semiconductor devices having a circuit pattern formed thereon. The xe2x80x9cfirst and second linesxe2x80x9d on the surface to be inspected are, thus, part of the circuit pattern. The system has no particular utility for inspecting surfaces which do not include orthogonal patterns of lines and which contain defects which do not isotopically scatter impinging light. Such limitations render this system particularly unsuitable for inspecting irregular parts having large painted surfaces.
U.S. Pat. No. 4,918,321 to Klenk et al. discloses a method for the detection of blemishes on the surface of the object. The system uses a strip of light which is moved over the surface of the workpiece. Striplike sections of the surface being inspected are in each case recorded stepwise in the region of the strip of light, the step size of successive recordings being smaller than the width of the strip of light. The light reflected from the surface is directed onto an opto-electronic video camera by means of a movable reflecting means which controls the increment of movement between adjacent images. Since the Klenk system relies on a movable reflecting means, this creates the difficult problem of coordinating movement of the reflecting means over the surface of the workpiece if the surface is curved and complex.
U.S. Pat. No. 5,237,404 to Tanaka discloses a surface defect inspection system which interrogates the workpiece surface with radiating light having a predetermined change pattern. A camera is arranged for receiving an image of the irradiating, structured light which is reflected by the surface. The structured light contains gradations in intensity. The system looks for disruptions in the pattern of the structured light by taking partial derivatives of the wave form of the video signal.
Ideally, an automated system useful for inspecting workpieces having painted surfaces, such as vehicle body panels, should possess several important characteristics. First, the system should be able to isolate and detect individual flaws in the painted surface such as are caused by dirt or other foreign substances, pinholes or scratches in the paint finish, etc. Thus, it is important that the system be able to distinguish between defects which are raised or elevated above the paint surface (often caused by dirt or other foreign particles) and defects which are depressed below the nominal paint surface (such as caused by interruptions in the paint coat). Furthermore, it would be highly advantageous if such a system were able to characterize the defects by size so that only those body parts having defects larger than a certain reference size would need to be rejected.
Many painted workpieces such as vehicle body panels have certain structural features, such as, for example, cutouts for the door handle on a side body panel. Each such panel can be expected to have the same cutout in the same location. Thus, it would be highly desirable for an automated inspection system to be able to distinguish between these expected interruptions in the surface and true defects.
The present system and method have been designed to provide the desirable characteristics of an automated inspection system described above. Disclosed herein is a system and method for detecting defects on a surface, and particularly on a painted surface such as an automobile body panel. The system is capable of characterizing surface defects in a number of ways, including by size of the defect and by surface elevation of the defect (that is, whether it is a crater or a piece of foreign matter). The system is also capable of xe2x80x9clearningxe2x80x9d to recognize known features on the workpiece, such as, for example, a cutout for a door handle on a side auto body panel.
The system of the present invention comprises three main parts. The first part is the optical components, including a light source capable of projecting a line of light having leading and trailing edges or transitions from dark to bright. In one embodiment, the light source is a diffuse light source which radiates light through a slit to produce a line of light. The width of the slit is chosen with some care to meet the dual criteria of being wide enough that the surface roughness of the paint on the workpiece to be inspected (the xe2x80x9corange peelxe2x80x9d) does not throw a shadow, yet narrow enough that the more severely sloped dirt particles and craters do throw shadows. The system uses differences in the intensity of the light reflected back from the surface of the workpiece to detect dirt or other foreign particles in the paint. It would be undesirable for the system to mistake natural surface roughness of the paint for actual defects. In one embodiment, the system detects shadows cast by defects. In an alternate embodiment, the system detects light backscattered by dirt or other foreign particles in the paint. In yet another embodiment, the system detects both shadows cast by defects and the light backscattered by defects.
A moving substrate carries a succession of workpieces in a linear direction, the direction of travel of the substrate being perpendicular to the line of light projected from the light source. Thus, workpieces that are traveling on the substrate will sequentially pass through the line of light at right angles with respect thereto. Any given position on a workpiece will first pass through the trailing edge of the projected line of light and subsequently through the leading edge thereof.
A detector is provided which has a field of view that includes the area illuminated by the line of light. Since the workpieces travel in a direction perpendicular to the line of light, the detector will successively image all portions of each workpiece as the workpiece travels along with the substrate. The detector is further operative to produce signals which vary as the amplitude of the light scattered (either reflected and/or backscattered) by the surface onto the detector varies in amplitude. In a preferred embodiment, the detector is a charge coupled device detector including a linear array of charged coupled devices.
In the embodiment of the invention in which defects are detected by the shadows they throw, each location on the workpiece is imaged at least twice while traveling through the line of light. A first image is captured when the location is in the line of light and proximate the trailing edge thereof; a final image is captured when the location is proximate the leading edge of the line of light.
In the embodiment of the invention in which defects are detected by the light which they scatter back into the detector, each location on the workpiece is imaged at least twice while traveling outside the line of light.
The system of the present invention further includes means for adjusting the image processing to the rate of travel of the substrate. Depending on the production environment, the substrate may travel at varying rates of speed. The faster that the substrate (and workpieces carried thereon) travels, the further each location on a workpiece will travel during one captured image of the detector. In the embodiment of the invention in which defects are detected by shadows they throw, xcex94t (the time interval between scans) must be less than one-half the time it takes a location on the workpiece to travel from a position proximate the leading edge of the line of light to a position proximate the trailing edge thereof.
The second portion of the system is image processing equipment. First, the signal produced by the detector is digitized. The signals are converted from a two-dimensional data stream into a three-dimensional array by providing memory locations corresponding to each position on a three-dimension array in which the digital data is stored. If there is a defect at a location on the workpiece, the defect causes a variation in the amplitude of the light scattered from the workpiece surface onto the detector. This variation in amplitude is detected by the detector, digitized, and stored as described. Moreover, because the defect is imaged at least twice, each defect generates two separate sets of digital data, both of which are stored by the system. However, because the angle of light incident on the defect is different for each of the two images (since the defect is moving relative to the light source), the two sets of data representing shadows cast by the defect in one embodiment, or light backscattered by the defect in another embodiment, in the first and second images are slightly different.
The data is subjected to further digital processing in order to perform a correlation between the output signals from the detector gathered during the two captured images. In one embodiment of the system and method of the present invention, the two sets of image data are first passed through a finite impulse response filter (FIR) whose characteristic spatial frequency response is tuned to the rate of travel of the substrate. This serves to isolate and amplify the variation in amplitude caused by the defect. The filtered signals are then subjected to a subtraction (one set of data is subtracted from the other) to achieve a composite set of data. However, it is to be understood that these steps of filtering and subtracting may be performed in reverse order, in certain cases, so that the subtraction operation is performed first, and the composite signal is then passed through the FIR.
After the image has been processed, it is then subjected to the third element of the system, namely, post processing. Post processing is performed in a computer programmed with a software program capable of recognizing processed image data which represents defects, and classifying defects so identified by a particular characteristic, such as size, or surface elevation. For example, if the defect is a crater, then it will cast different and unique shadow patterns in each of the first and second images, resulting in a characteristic composite shadow pattern unique for craters. The characteristic patterns for craters are stored in the software. The program compares the processed image data with the stored data and determines whether the defect is a crater. The software can also store characteristic shadow patterns for other types of defects (such as bumps or pieces of foreign debris) so that the software can compare the processed image data and, again, determine whether the defect is an elevated defect.
The post processing software is also capable of being xe2x80x9ctaughtxe2x80x9d to recognize known surface variations in the workpieces. The system of the present invention can be used in a trial run with a plurality of workpieces (such as auto body side panels) which all have, for example, a door handle cut out in the same position. The post processing software can identify this particular characteristic on every workpiece and learn to expect it in a particular workpiece location. After the trial run, the system will subtract this known characteristic every time it processes the images for a new workpiece since the software has xe2x80x9clearnedxe2x80x9d to expect this particular feature in this particular location. Since the system of the present invention is capable of learning to distinguish expected surface variations from unexpected ones, it can be used to inspect a wide variety of workpiece types, even those which are highly irregular. Thus, the system and method of the present invention display extreme versatility.